/*
 * @brief:
 *
 * @author: dariaye@tencent.com
 * @date: 2012-7-16
 * @version: 1.0
 * @changes:
 *    <author>        <time>        <version >        <desc>
 *     dariaye             2012-7-16              1.0                 Create
 */

#ifndef PLSA_COMMON_LOG_UTIL_H
#define PLSA_COMMON_LOG_UTIL_H

#include <stdlib.h>
#include <log/log.h>

extern char kInfoFileName[PATH_MAX];
extern char kErrorFileName[PATH_MAX];

LOG_DECLARE(plsa_log_info);
LOG_DECLARE(plsa_log_error);

void SetPLSALogFileName(const char * info_log_file_name, const char * error_log_filename,
        BASE::Log::kLogLevel log_level = BASE::Log::kLogLevel::kInfoLog,
        BASE::Log::kLogOutPut log_output = BASE::Log::kLogOutPut::kBoth);

void CloseLog();

#define PLSA_INFO_LOG(format, ...) INFO_DAY_LOG_v2(plsa_log_info, kInfoFileName, format, ##__VA_ARGS__)
#define PLSA_WARNING_LOG(format, ...) WARNING_DAY_LOG_v2(plsa_log_info, kInfoFileName, format, ##__VA_ARGS__)
#define PLSA_DEBUG_LOG(format, ...) DEBUG_DAY_LOG_v2(plsa_log_info, kInfoFileName, format, ##__VA_ARGS__)
#define PLSA_ERROR_LOG(format, ...) ERROR_DAY_LOG_v2(plsa_log_error, kErrorFileName, format, ##__VA_ARGS__)
#define PLSA_FATAL_LOG(format, ...) FATAL_DAY_LOG_v2(plsa_log_error, kErrorFileName, format, ##__VA_ARGS__)

#endif /* PLSA_COMMON_LOG_UTIL_H */
